﻿using System;
using System.Collections.Generic;
using System.Linq;
using Sportsbook.Domain.Models.Bets;
using Sportsbook.Domain.Repositories;
using Sportsbook.InMemoryPersistence.Models.Bets;

namespace Sportsbook.InMemoryPersistence.Repositories
{
    public class BetsRepository : IBetsRepository
    {
        private IEnumerable<Bet> GetList()
        {
            var bets = new List<Bet>
                {
                    new Bet
                    {
                        CustomerId = "cesarbmx",
                        Ip = "218.36.52.214",
                        Status = BetStatus.Accepted,
                        Time = DateTime.Now
                    },
                    new Bet
                    {
                        CustomerId = "cesarbmx",
                        Ip = "218.36.52.214",
                        Status = BetStatus.Accepted,
                        Time = DateTime.Now
                    }
            };
            bets[0].Tickets.Add(new Ticket());
            bets[1].Tickets.Add(new Ticket());

            return bets;
        }

        public List<IBet> Get(string customerId)
        {
            return GetList().Cast<IBet>().ToList();
        }

        public void Save(IBet model, string customerId)
        {
            throw new NotImplementedException();
        }
    }
}